﻿using System;
using System.Web.UI;



namespace mojoPortal.Web.RS.PRM
{
    public partial class RSPropertyDetail : RSBasePage
    {
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                InitializeReadyServicePage("Property Detail");
                RSUserIdentity userIdentity = GetRSUserIdentity();

                int propertyid = 0;
                if(Request.QueryString["propid"] != null)
                    propertyid = int.Parse(Request.QueryString["propid"].ToString());

                if (propertyid > 0)
                {
                    hfPropertyID.Value = propertyid.ToString();
                    ucPropertyHeaderControl.LoadPropertyHeader(userIdentity.RSCompanyId, propertyid);
                    ucPropertyDetailControl.LoadPropertyData(userIdentity.RSCompanyId, propertyid);
                }

            }
        }

        protected void tcPropertyDetail_OnActiveTabChanged(object sender, EventArgs e)
        {
            int propertyid = hfPropertyID.Value == "" ? 0 : int.Parse(hfPropertyID.Value);
            switch (tcPropertyDetail.ActiveTabIndex)
            {
                case 0:
                    //Response.Redirect("RSPropertyDetail.aspx?propid=" + propertyid.ToString());
                    break;
                case 1:
                    Response.Redirect("RSAccountInfo.aspx?propid=" + propertyid.ToString());
                    break;
                //default:
            }
        }
    }

}
